﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
//文本框自适应
public class TextAdapter : MonoBehaviour {

    public Image bg;
    public Text text;

	
	// Update is called once per frame
	void Update ()
    {
        bg.GetComponent<RectTransform>().sizeDelta = text.gameObject.GetComponent<RectTransform>().sizeDelta + new Vector2(50, 60);
    }
}
